<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="/resource/css/admin/main.css" type="text/css" rel="stylesheet" />
<link href="/resource/css/admin/right.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/resource/js/jquery.js"></script>
<script type="text/javascript" src="/resource/js/base.js"></script>
<script type="text/javascript" src="/resource/js/admin/columnsedit.js"></script>
</head>
<body>
	<div class="position"><span>您的当前位置：</span>网站维护 > <a href="./">网站栏目管理</a> > ${(columns.id == 0)?string("新建","修改")}${(parentid == 0)?string("一","二")}级栏目</div>
	<form method="post" action="editdo" onsubmit="return checkform()">
		<div class="rightbody m">
			<div class="rightbodycontent">
				<table cellspacing="1" cellpadding="4" class="tableedit">
					<tr>
						<td>栏目类型：</td>
						<td>
							<#list columnstypes as type>
								<label><input type="radio" name="typeid" value="${type.id}"<#if type.id == columns.columnsType.id> checked</#if> onchange="swtichcolumnstype(this)" />${type.name}</label>
							</#list>
						</td>
					</tr>
		            <tr>
		                <td>栏目名称：</td>
		                <td>
		                	<input type="text" name="name" id="name" value="${columns.name!}" /> <span style="color:red">*</span>
		                </td>
		            </tr>
		            <tr class="columnsproperty" id="trurldirectory"<#if columns.columnsType.id != 2 && columns.columnsType.id != 4> style="display:table-row;"</#if>>
		                <td><span class="trname">文件目录</span>：</td>
		                <td><input type="text" name="urldirectory" id="urldirectory" value="${columns.urldirectory!}" style="width:600px" /> <span style="color:red">*</span><span class="noticemsg"> 请使用英文字母，不要包含中文、标点等特殊符号。</span></td>
		            </tr>
		            <tr class="columnsproperty" id="trdatamodel"<#if columns.columnsType.id == 1> style="display:table-row;"</#if>>
		                <td>数据模型：</td>
		                <td>
		                    <select name="datamodelid">
			                    <#list datamodels as datamodel>
			                    	<option value="${datamodel.id}"<#if columns.datamodel?? && datamodel.id == columns.datamodel.id> selected</#if>>${datamodel.name}</option>
			                    </#list>
		                    </select>
		                </td>
		            </tr>
		            <tr class="columnsproperty" id="trtemplatelistdetial"<#if columns.columnsType.id == 1> style="display:table-row;"</#if>>
		                <td>模板选择：</td>
		                <td>
							列表模板：
		                    <select name="templatelist">
			                    <#list templatefiles as templatefile>
			                    	<#if templatefile.name?contains('.htm') && templatefile.name?starts_with('list')>
			                    		<option value="${templatefile.name}"<#if columns.templatelist?? && templatefile.name == columns.templatelist> selected</#if>>${templatefile.name}</option>
			                    	</#if>
			                    </#list>
		                    </select>
		                    <br />
							详细模板：
		                    <select name="templatedetail">
			                    <#list templatefiles as templatefile>
			                    	<#if templatefile.name?contains('.htm') && templatefile.name?starts_with('detail')>
			                    		<option value="${templatefile.name}"<#if columns.templatedetail?? && templatefile.name == columns.templatedetail> selected</#if>>${templatefile.name}</option>
			                    	</#if>
			                    </#list>
		                    </select>
		                </td>
		            </tr>
		            <tr class="columnsproperty" id="trgroupbydepartment"<#if columns.columnsType.id == 1> style="display:table-row;"</#if>>
		        		<td>部门分组：</td>
				        <td>
				        	<#list departments as department>
				        		<label><input type="checkbox" name="departmentids" value="${department.id}"<#if departmentids?seq_contains(department.id)> checked</#if>/>${department.name}</label>
				        	</#list>
				        </td>
			        </tr>
		            <tr class="columnsproperty" id="trautosingle"<#if columns.columnsType.id == 1> style="display:table-row;"</#if>>
		                <td>自动单页：</td>
		                <td>
		                    <label><input type="radio" name="autosingle" value="true"<#if !columns.autosingle?? || columns.autosingle> checked</#if> />是</label>
		                    <label><input type="radio" name="autosingle" value="false"<#if columns.autosingle?? && !columns.autosingle> checked</#if> />否</label>
		                    &nbsp;&nbsp;当栏目列表数据只有一条时，自动调取详细模板。
		                </td>
		            </tr>
		            <tr class="columnsproperty" id="trzhuanti"<#if columns.columnsType.id == 2> style="display:table-row;"</#if>>
		                <td>关联专题：</td>
		                <td>
		                    <select name="zhuantiid">
		                    	<#list zhuantis as zhuanti>
		                    		<option value="${zhuanti.id}"<#if columns.zhuanti?? && zhuanti.id == columns.zhuanti.id> selected</#if>>${zhuanti.name}</option>
		                    	</#list>
		                    </select>
		                </td>
		            </tr>
		            <tr class="columnsproperty" id="trtemplateother"<#if columns.columnsType.id == 3> style="display:table-row;"</#if>>
		                <td>模板选择：</td>
		                <td>
		                    <select name="templateother">
			                    <#list templatefiles as templatefile>
			                    	<#if templatefile.name?contains('.htm') && !templatefile.name?starts_with('index') && !templatefile.name?starts_with('zhuanti') && !templatefile.name?starts_with('list') && !templatefile.name?starts_with('detail') && !templatefile.name?starts_with('leavemessage')>
			                    		<option value="${templatefile.name}"<#if columns.templateother?? && templatefile.name == columns.templateother> selected</#if>>${templatefile.name}</option>
			                    	</#if>
			                    </#list>
		                    </select>
		                </td>
		            </tr>
		            <tr class="columnsproperty" id="trtarget"<#if columns.columnsType.id != 4> style="display:table-row;"</#if>>
		                <td>跳转方式：</td>
		                <td>
		                    <label><input type="radio" name="target" value="_blank"<#if !columns.target?? || columns.target == '_blank'> checked</#if> />_blank</label> <span style="color:gray">（新窗口跳转）</span><br />
		                    <label><input type="radio" name="target" value="_parent"<#if columns.target?? && columns.target == '_parent'> checked</#if>>_parent</label> <span style="color:gray">（父窗口跳转）</span><br />
		                    <label><input type="radio" name="target" value="_self"<#if columns.target?? && columns.target == '_self'> checked</#if>>_self</label> <span style="color:gray">（本窗口跳转）</span><br />
		                    <label><input type="radio" name="target" value="_top"<#if columns.target?? && columns.target == '_top'> checked</#if>>_top</label> <span style="color:gray">（最顶层窗口跳转）</span>
		                </td>
		            </tr>
					<tr>
						<td>显示：</td>
						<td>
							<label><input type="radio" name="display" value="true"<#if !columns.display?? || columns.display> checked</#if> />是</label>
		                    <label><input type="radio" name="display" value="false"<#if columns.display?? && !columns.display> checked</#if> />否</label>
						</td>
					</tr>
					<tr>
						<td>排序：</td>
						<td>
							<input type="text" name="sort" id="sort" value="${columns.sort}" /> <span style="color:red">*</span>
						</td>
					</tr>
					<tr>
						<td>父ID：</td>
						<td>
							<input type="text" name="parentid" id="parentid" value="${columns.parentId}" /> <span style="color:red">*</span>
						</td>
					</tr>
				</table>
				<input type="hidden" name="columnsid" value="${columns.id}" />
			</div>
		</div>
		<div class="rightfoot">
			<div class="rightfootcontent">
	            <input type="button" value="返 回" class="return" onclick="history.back()" />&nbsp;
	            <input type="submit" value="保 存" class="save" />
            </div>
        </div> 	
	</form>
</body>
</html>